package com.css.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.css.entity.DistrictBoundaryProvinceEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Dbj
 * @date 2024年11月05日  11:13
 */
@Mapper
@DS(value = "slave")
public interface DistrictBoundaryProvinceMapper extends BaseMapper<DistrictBoundaryProvinceEntity> {
    @Select("select name,code,ST_Area(ST_Transform(ST_Intersection(geom, st_geometryfromtext(#{geom},4490)),4527))/1000000 as area,st_astext(ST_Intersection(geom, st_geometryfromtext(#{geom},4490))) as intersectGeom from data_province where  ST_Intersects(geom, st_geometryfromtext(#{geom},4490))")
    List<DistrictBoundaryProvinceEntity> getIntersectProvince(@Param("geom") String geom);
}
